home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / net / bind-contrib.tar.gz / bind-contrib.tar / contrib / doc / doc1.awk < prev    next >
Text File  |  1996-10-25  |  491b  |  33 lines

  1. #
  2. # doc1.awk
  3. #
  4. #      Distributed with:  Doc - Version 2.0 (8/22/90)
  5. #      USC Information Sciences Institute
  6. #
  7. # Accepts as input, output from dig querying for SOA of a domain.
  8. # Expects input to be lower case.
  9. #
  10. # Prints serial # of SOA (only one)
  11. # Exit status indicates:
  12. #    o response was authoritative (or not)
  13. #    o number of SOA records found
  14. #
  15.  
  16. BEGIN {aa=0; ss=0}
  17.  
  18. /flags:/ && /aa/ {aa++}
  19.  
  20. $3 == "serial" {soa=$1; ss++}
  21.  
  22. END {
  23. print soa
  24.  
  25. if (aa==0) 
  26.   {ss=0-ss};
  27. exit(ss);
  28. }
  29.  
  30.  
  31.  
  32.  
  33.